from page.page01_index import app_index
from page.page02_login import app_login
from appium.webdriver.common.appiumby import By

from tools import *


def app_login_success():
    driver = app_driver()
    # 进入首页
    app_index(driver)
    phone = "14000000000"
    pwd = "123456"
    app_login(driver, phone, pwd)
    information = driver.find_element(by=By.ID, value="com.tpshop.malls:id/nick_name_tv").text
    assert phone == information
    driver_quit(driver)

def app_login_fail():
    driver = app_driver()
    app_index(driver)
    phone = "14000000011"
    pwd = "123456"
    app_login(driver, phone, pwd)
    information = driver.find_element(by=By.ID, value="com.tpshop.malls:id/mobile_et").text
    assert phone == information
    driver_quit(driver)

if __name__ == '__main__':
    # app_login_success()
    app_login_fail()
